package com.qingke.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qingke.mapper.InClassTeacherMapper;
import com.qingke.pojo.InClassTeacher;
import com.qingke.service.InClassTeacherService;

@Service("inClassTeacherService")
public class InClassTeacherServiceImpl implements InClassTeacherService {
	@Resource
	private InClassTeacherMapper inClassTeacherDao;

	public int saveInClassTeacher(InClassTeacher record) {
		return inClassTeacherDao.insertSelective(record);
	}

	public InClassTeacher getInClassTeacherById(int id) {
		return inClassTeacherDao.selectByPrimaryKey(id);
	}

	public List<InClassTeacher> listInClassTeacher() {
		return inClassTeacherDao.listInClassTeacher();
	}

	public int updateInClassTeacher(InClassTeacher record) {
		return inClassTeacherDao.updateByPrimaryKeySelective(record);
	}

	public boolean isTeacherInClass(int employeeId, int classId) {
		InClassTeacher ict=inClassTeacherDao.selectByEmployeeIdAndClassId(employeeId, classId);
		if(ict!=null){
			return true;
		}else{
			return false;
		}
	}

}
